<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
<input type="text" placeholder="员工姓名" v-model="e.name">
<input type="text" placeholder="员工工资" v-model="e.sal">
<input type="text" placeholder="员工工作" v-model="e.job">
<input type="button" value="添加员工"  @click="add()">
<table border="1">
  <caption>员工列表</caption>
  <tr>
    <td>序号：</td><td>姓名</td><td>工资</td><td>职位</td>
  </tr>
  <tr v-for="(emp,i) in arr ">
    <td>{{i+1}}</td>
    <td>{{emp.name}}</td>
    <td>{{emp.sal}}</td>
    <td>{{emp.job}}</td>\<td>
    <input type="button" value="删除" @click="del(i)"></td>
  </tr>
</table>
</div>
<script src="http://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script>
  let v=new Vue({
            el:"body>div",
            data:{
              e:{name:"",sal:"",job:""},
              arr:[{name:"张三",sal:"3000",job:"销售"},
                {name:"李四",sal:"4000",job:"人事"}],

            },
    methods:{
     add(){
        v.arr.push({name:v.e.name,sal:v.e.sal,job:v.e.job})
     },
      del(i){
       v.arr.splice(i,1)
      }
    }
          })
</script>
</body>
</html>